package com.kingsoft.demo.core;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;

public class TestTransient {
	
	public static void write(){
		
		LoggingInfo logInfo = new LoggingInfo("MIKE", "MECHANICS");   
		System.out.println(logInfo.toString());   
		try  
		{   
		   ObjectOutputStream o = new ObjectOutputStream(   
		                new FileOutputStream("logInfo.out"));   
		   o.writeObject(logInfo);   
		   o.close();   
		}   
		catch(Exception e) {
		  
			e.printStackTrace();
		}
	}
	
	public static void read(){
		
		try  
		{   
		   ObjectInputStream in =new ObjectInputStream(   
		                new FileInputStream("logInfo.out"));   
		   LoggingInfo logInfo = (LoggingInfo)in.readObject();   
		   System.out.println(logInfo.toString());   
		}   
		catch(Exception e) {
			e.printStackTrace();
		
		}
	}
	
	public static void main(String[] args) {
		
		write();
		read();
	
	}

}
